%macro wordcount(list);
%local count;
%let count=0;
%do %while(%qscan(&list.,&count.+1,%str( )) ne %str() );
 %let count=%eval(&count.+1);
%end;
&count.
%mend wordcount;

%macro renam_vars(varlist,end);
%do i=1 %to %wordcount(&varlist.);
%let var=%scan(&varlist.,&i.);
&var.=&var.&end.
%end;
%mend;
